import request from '../../utils/request';
import {download} from '../../utils/commons'
const R=require("ramda");
/**
 * 查询外汇信息
 * @param lesseesCode
 * @param beginTime
 * @param endTime
 * @param page
 */
export async function getForexList({beginTime, endTime,status, page}) {
    return request(apiPath.imagent + "/api/report/forex",
        {
            method: 'get',
            data: { beginTime: beginTime, endTime: endTime,status:status, page: page.page, size: page.size}
        });
}


/**
 * 导出外汇信息
 * @param lesseesCode
 * @param beginTime
 * @param endTime
 */
export async function exportForexList({beginTime, endTime,status}) {
    let url =  apiPath.imagent + "/api/report/forex/export";
    let data={};
    beginTime=R.isNil(beginTime)?'':beginTime;
    endTime=R.isNil(endTime)?'':endTime;
    status=R.isNil(status)?'':status;
    data={beginDate: beginTime, endDate: endTime,status:status, filename: '外汇信息表'}
    download(url, data);
}



